<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@include file="/WEB-INF/template/common/header.jsp"%>
<div class="pageHeader">
	<form onsubmit="return navTabSearch(this);"
		action="${base }/product!list.action" method="post"
		rel="pagerForm" id="productListForm">
		<div class="searchBar">
			<table class="searchContent">
				<tr>
					<td>搜索关键词<input type="text" name="product.title"
						value="${product.title }" alt="请输入关键词 " size="30" /></td>
				</tr>
			</table>
			<div class="subBar">
				<ul>
					<li><div class="buttonActive">
							<div class="buttonContent">
								<button type="submit">检索</button>
							</div>
						</div></li>
				</ul>
			</div>
		</div>
	</form>
</div>
<div class="pageContent">
	<div class="panelBar">
		<ul class="toolBar">
			<li><a class="add" href="${base }/product!add.action"
				target="navTab" rel="product_add"><span>添加产品</span></a></li>
			<li><a class="edit" href="${base }/product!index.action"
				target="ajaxTodo" rel="product_index"><span>更新索引</span></a></li>
			<li><a class="delete"
				href="${base }/product!deleteIndex.action" target="ajaxTodo"
				rel="product_index"><span>删除索引</span></a></li>
			<li class="line">line</li>
		</ul>
	</div>
	<table class="table" width="100%" layoutH="138">
		<thead>
			<tr>
				<th width="22"><input type="checkbox" group="ids"
					class="checkboxCtrl"></th>
				<th width="80">名称</th>
				<th width="20">链接</th>
				<th width="40">售价</th>
				<th width="20">分类</th>
				<th width="20">来源</th>
				<th width="100">简介</th>
				<th width="80">操作</th>
			</tr>
		</thead>
		<tbody>
			<c:forEach items="${products }" var="product">
				<tr target="product" rel="${ product.id}">
					<td><input name="ids" value="${product.id }" type="checkbox">
					</td>
					<td>${product.title }</td>
					<td>${product.targetUrl}</td>
					<td>$${product.price}</td>
					<td>${product.category.title}</td>
					<td>${product.source}</td>
					<td><c:choose>
							<c:when test="${fn:length(product.summary) > 200}">
								<c:out value="${fn:substring(product.summary, 0, 200)}......" />
							</c:when>
							<c:otherwise>
								<c:out value="${product.summary}" />
							</c:otherwise>
						</c:choose></td>
					<td><a title="${product.title }" href="${product.targetUrl}"
						target="_blank" class="btnView">查看</a> <a
						title="${product.title }" rel="product_edit" target="navTab"
						href="${base }/product!edit.action?product.id=${product.id}"
						class="btnEdit">编辑</a> <a title="确定要删除该商品?" target="ajaxTodo"
						href="${base }/product!delete.action?product.id=${product.id}"
						class="btnDel">删除</a></td>
				</tr>
			</c:forEach>
		</tbody>
	</table>
</div>
<cy:pagination pageBean="${pager }"
	pageUrl="${base }/product!list.action">
	<%@include file="/WEB-INF/template/common/pagination.jsp"%>
</cy:pagination>